<template>
  <!-- 结果弹窗 -->
  <a-modal
    :visible.sync="dialogVisible"
    :footer="false"
    @cancel="handleCancel"
    width="400px"
  >
    <a-result :status="status" style="padding:0">
      <template #title>
        <slot name="title"/>
      </template>
      <template #subTitle>
        <slot name="subTitle"/>
      </template>
      <template #extra>
        <slot name="extra"/>
      </template>
    </a-result>
  </a-modal>
</template>

<script>
export default {
  props: {
    // 显隐控件
    visible: {
      type: Boolean,
      default() {
        return false
      },
    },
    // 提示状态
    status: {
      type: String,
      default() {
        return 'warning'
      },
    },
    // 提示信息
    title: {
      type: String,
      default() {
        return ''
      },
    },
  },
  computed: {
    // 弹窗控件
    dialogVisible: {
      get: function () {
        return this.visible
      },
      set: function (e) {
        this.$emit('update:visible', e)
      },
    },
  },
  data() {
    return {}
  },
  methods: {
    handleOk() {
      this.loading = true
      this.$emit('confirm')
    },
    handleCancel() {
      this.dialogVisible = false
    },
  }
}
</script>

<style>
</style>
